﻿//-----------------------------------------------------------------------
// <copyright file="Copyright.cs" author="Michael Herndon">
//     Copyright (c) Company.  All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Amplify.CodeDom
{
	using System;
	using System.CodeDom;
	using System.Collections.Generic;
	using System.Linq;
	using System.Text;

	public static partial class Mixin
	{
		public static CodeFieldReferenceExpression Field(this CodeThisReferenceExpression unit, string fieldname)
		{
			return new CodeFieldReferenceExpression(unit, fieldname);
		}

		

		
	}

	public class This : CodeThisReferenceExpression
	{
		public This()
			: base()
		{

		}

		public static CodeFieldReferenceExpression Field(string fieldName)
		{
			return new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), fieldName);
		}

		public static CodePropertyReferenceExpression Property(string propertyName)
		{
			return new CodePropertyReferenceExpression(new CodeThisReferenceExpression(), propertyName);
		}

		public static CodeMethodReferenceExpression Method(string methodname)
		{
			return new CodeMethodReferenceExpression(new This(), methodname);
		}

		public static CodeMethodInvokeExpression InvokeMethod(string methodName, IEnumerable<CodeExpression> parameters)
		{
			return new CodeMethodInvokeExpression(new CodeThisReferenceExpression(), methodName, parameters.ToArray());
		}
	}
}
